package com.example.demo.widget.chart.histogram

import android.graphics.Color
import android.support.annotation.ColorInt

class DrawInfoBuilder {
    var paddingLeft = 36f
    var paddingRight = 36f
    var paddingTop = 36f
    var paddingBottom = 36f
    var contentBgColor = Color.WHITE
    var titleTextSize = 36f
    var titleTextBold = true
    var titleTextColor = Color.BLACK
    var titleToBottom = 36f
    var itemTextSize = 36f
    var itemTextPadding = 12f
    var rectRadius = 6
    var shadowSize = 24
    var itemTextBold = true

    fun itemTextBold(itemTextBold: Boolean): DrawInfoBuilder {
        this.itemTextBold = itemTextBold
        return this
    }

    fun rectRadius(rectRadius: Int): DrawInfoBuilder {
        this.rectRadius = rectRadius
        return this
    }

    fun shadowSize(shadowSize: Int): DrawInfoBuilder {
        this.shadowSize = shadowSize
        return this
    }

    fun paddingLeft(paddingLeft: Float): DrawInfoBuilder {
        this.paddingLeft = paddingLeft
        return this
    }

    fun paddingTop(paddingTop: Float): DrawInfoBuilder {
        this.paddingTop = paddingTop
        return this
    }

    fun paddingRight(paddingRight: Float): DrawInfoBuilder {
        this.paddingRight = paddingRight
        return this
    }

    fun paddingBottom(paddingBottom: Float): DrawInfoBuilder {
        this.paddingBottom = paddingBottom
        return this
    }

    fun contentBgColor(@ColorInt contentBgColor: Int): DrawInfoBuilder {
        this.contentBgColor = contentBgColor
        return this
    }

    fun titleTextSize(titleTextSize: Float): DrawInfoBuilder {
        this.titleTextSize = titleTextSize
        return this
    }

    fun titleToBottom(titleToBottom: Float): DrawInfoBuilder {
        this.titleToBottom = titleToBottom
        return this
    }

    fun itemTextSize(itemTextSize: Float): DrawInfoBuilder {
        this.itemTextSize = itemTextSize
        return this
    }

    fun itemTextPadding(itemTextPadding: Float): DrawInfoBuilder {
        this.itemTextPadding = itemTextPadding
        return this
    }

    fun titleTextBold(titleTextBold: Boolean): DrawInfoBuilder {
        this.titleTextBold = titleTextBold
        return this
    }

    fun titleTextColor(@ColorInt titleTextColor: Int): DrawInfoBuilder {
        this.titleTextColor = titleTextColor
        return this
    }

    fun build(): DrawInfoHelper {
        return DrawInfoHelper(this)
    }
}